﻿@using NetCoreCMS.Models;
@{
   Layout = "~/Areas/Admin/Views/Shared/_LayoutList.cshtml";
    ViewBag.Title = "Manager_Log";
    List<Manager_log> list = ViewData["list"] as List<Manager_log>;
}
@section HeaderContent{
   <script>
      //查询数据
      function search() {
         var text = $("#txtKeywords").val();
         var pageCount = $("#txtPageNum").val();
         document.location = "index?keywords=" + text + "&pageNum=" + pageCount;
      }

      //删除数据
      function __doPostBack() {
         var text = $("#txtKeywords").val();
         $.ajax({
            url: "SubmitDelete?keywords=" + text,
            type: "POST",
            dataType: "html",
            success: function (data) {
               eval(data);
            },
            error: function () {
               alert("error");
            }
         });
      }
   </script>
}
<form id="form1"  method="post" action="#">
<!--导航栏-->
<div class="location">
  <a href="javascript:history.back(-1);" class="back"><i class="iconfont icon-up"></i><span>返回上一页</span></a>
  <a href="../center/index"><i class="iconfont icon-home"></i><span>首页</span></a>
  <i class="arrow iconfont icon-arrow-right"></i>
  <span>管理日志</span>
</div>
<!--/导航栏-->

<!--工具栏-->
<div id="floatHead" class="toolbar-wrap">
  <div class="toolbar">
    <div class="box-wrap">
      <a class="menu-btn"><i class="iconfont icon-more"></i></a><a class="menu-btn"><i class="iconfont icon-more"></i></a>
      <div class="l-list">
        <ul class="icon-list">
          <li><a href="javascript:;" id="btnDelete" onclick="ExeNoCheckPostBack('btnDelete','删除7天前的管理日志，你确定吗?');"><i></i><span>删除日志</span></a></li>
        </ul>
      </div>
      <div class="r-list">
        <input type="text" id="txtKeywords" class="keyword" value="@ViewBag.Keywords" />
        <a href="javascript:search();" id="lbtnSearch" class="btn-search"><i class="iconfont icon-search"></i></a>
      </div>
    </div>
  </div>
</div>
<!--/工具栏-->

<!--列表-->
<div class="table-container">
  <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ltable" id="ltable">
    <tr>
      <th width="10%">用户名</th>
      <th width="15%">操作类型</th>
      <th align="left">备注</th>
      <th align="left" width="15%">用户IP</th>
      <th align="left" width="16%">添加时间</th>
    </tr>
@foreach(Manager_log dr in list){
    <tr>
      <td align="center">
        <a href="index?keywords=@dr.user_name"]">@dr.user_name</a>
      </td>
      <td align="center">
        <a href="index?keywords=@dr.action_type"]">@dr.action_type</a>
      </td>
      <td>@dr.remark</td>
      <td>@dr.user_ip</td>
      <td>@dr.add_time.ToString("yyyy-MM-dd hh:MM:sss")</td>
    </tr>
}
@if (list.Count == 0) {
   <tr><td align="center" colspan="5">暂无记录</td></tr>
}
  </table>
</div>
<!--/列表-->

<!--内容底部-->
<div class="line20"></div>
<div class="pagelist">
  <div class="l-btns">
    <span>显示</span>
     <input type="text" id="txtPageNum" class="pagenum" onkeydown="return checkNumber(event);" onchange="search();" value="@ViewBag.PageNum" />
     <span>条/页</span>
  </div>
  <div class="default">@Html.Raw(ViewBag.PageContent)</div>
</div>
<!--/内容底部-->
</form>
